package com.dsg.workflow;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dsg.entity.apply.DsgApplyCard;
import com.dsg.entity.approve.DsgApproveCase;
import org.springframework.stereotype.Service;

/**
 * 補咭
 */
@Service
public class WorkflowService9 extends AbstractWorkflowService {

    @Override
    public void sendCardFillBack(DsgApproveCase approveCase) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("APP_NO", approveCase.getAppNo());
        DsgApplyCard card = cardService.getOne(wrapper);
        DsgApplyCard oldCard = cardService.getById(card.getOldCardId());
        if (DsgApplyCard.CARD_STATUS_5 != oldCard.getCardStatus()) {
            oldCard.setCardStatus(DsgApplyCard.CARD_STATUS_5);
            cardService.updateById(oldCard);
        }
    }
}
